package action.page;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.apache.struts2.ServletActionContext;
import bean.Operation;

/*
 * 点击管理操作
 */
public class Manage {
	public String execute() {
		// 得到HttpSession方法
		HttpSession session = ServletActionContext.getRequest().getSession();
		// 得到HttpServletRequest方法
		HttpServletRequest request = ServletActionContext.getRequest();

		// 判断用户是否登录
		if ("true".equals(session.getAttribute("login"))) {
			// 若已登陆成功，则在request对象中添加username键及值
			request.setAttribute("username", (String) session.getAttribute("username"));
			
			return "manage";
		} else {
			return "login";
		}
	}
}
